<%@ page pageEncoding="UTF-8"%>
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"  prefix="fmt"%>
<jsp:include page="common/header.jsp"></jsp:include>
<input type="hidden" name="projectName" id="projectName" value="${pageContext.request.contextPath }"/>
<h1><img src="${pageContext.request.contextPath}/views/images/icons/posts.png" alt="" /> 权限管理</h1>

<%-- <a id="button_add" class="mypage_button" href="${pageContext.request.contextPath}/module/add"><img src="${pageContext.request.contextPath}/views/images/icons/menu/dark/chart.png"/> 添加</a> --%>

<div class="bloc">
    <div class="title">
       模块列表
    </div>
    <div class="content" >
        <table>
            <thead>
                <tr>
                    <!-- <th><input type="checkbox" class="checkall"/></th> -->
                    <th>名称</th>
                    <th>链接</th>
                    <th>描述</th>
                    <th>顶级</th>
                    <th style="text-align:center;">操作</th>
                </tr>
            </thead>
            <tbody>
            	<c:forEach items="${modules}" var="item">
           			<c:if test="${item.type == 0}">
           			<tr style="color:red; font-weight:bold; font-size:16px; line-height:20px;">
           			</c:if>
           			<c:if test="${item.type != 0}">
           			<tr>
           			</c:if>
            		
	                    <!-- <td><input type="checkbox" /></td> -->
	                    <td>${item.name}</td>
	                    <td>${item.link}</td>
	                    <td>${item.description}</td>
	                    
	                    <c:if test="${item.type == 0}">
	                    <td>一级</td>
	                    <td></td>
	                    <c:set var="pName" value="${item.name}" />
	                    </c:if>
	                    <c:if test="${item.type != 0}">
	                    <td>二级</td>
	                    <td class="actions"><a href="${pageContext.request.contextPath}/admin-module/update?id=${item.id }&pName=${pName}" title="编辑信息"><img src="${pageContext.request.contextPath}/views/images/icons/actions/edit.png" alt="" /></a><a href="javascript:deletemodule(${item.id }, '${item.name }');" title="删除" ><img src="${pageContext.request.contextPath}/views/images/icons/actions/delete.png" alt="" /></a></td>
	                    </c:if>
	                </tr>
            	
            	</c:forEach>
                            </tbody>
        </table>
    </div>
</div>
<script type="text/javascript" src="${pageContext.request.contextPath}/views/js/module.js"></script>